<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String title = "ETB基础开发平台";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<title><%=title %></title>
	<head>
		<link rel="stylesheet" type="text/css" href="${path}/common/component/eui/themes/gray/eui.css">
		<link rel="stylesheet" type="text/css" href="${path}/common/component/eui/themes/icon.css">
		<script type="text/javascript" src="${path}/common/component/eui/jquery.min.js"></script>
		<script type="text/javascript" src="${path}/common/component/eui/jquery.collection.js"></script>
		<script type="text/javascript" src="${path}/common/component/eui/jquery.common.js"></script>
		<script type="text/javascript" src="${path}/common/component/eui/jquery.eui.min.js?${path}"></script>
		<script type="text/javascript" src="${path}/common/component/eui/locale/eui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="${path}/common/component/eui/extend/jquery.eui.extend.js"></script>
		<script type="text/javascript" src="${path}/common/component/eui/extend/jquery.validate.js"></script>
		<script type="text/javascript" src="${path}/common/component/eui/extend/jquery.dialog.js"></script>
	</head>
<body style='background-color:#176EC6;background:url(${path}/skin/green/images/bg.png)'>
	<div align="center">
		<div class="eui-panel" style="width:300px;margin-top:20%;background:url(${path}/skin/green/images/bg.png);text-align:center" data-options="border:false">
			<div><img src="${path}/skin/green/images/logo2.png" width="200px" height="200px"/></div><span style="color:#22BC85;font-weight:bold;font-size:30px;"><%=title %></span>
		</div>
		<div class="eui-panel" style="width:300px;margin-top:10%;background:url(${path}/skin/green/images/bg.png)" data-options="border:false">
			
			<div style="margin-bottom:5px;margin-left:5px">
				<span id="msg" style="color:#22BC85">&nbsp;</span>
			</div>
			<div style="margin-bottom:10px">
				<input class="eui-textbox" style="width:300px;height:40px;padding:12px" data-options="prompt:'用户名',iconCls:'icon-man',iconWidth:38,onKeydown:clearMsg" id="loginname" value="sysadmin">
			</div>
			<div style="margin-bottom:20px">
				<input class="eui-textbox" style="width:300px;height:40px;padding:12px" type="password" data-options="prompt:'密码     ',iconCls:'icon-lock',iconWidth:38,onKeydown:clearMsg" id="password" value="000000">
			</div>
			<div style="margin-bottom:20px">
				<input type="checkbox" checked="checked">
				<span style="color:#000">记住密码</span>
			</div>
			<div>
				<a href="javascript:login()" class="eui-linkbutton" data-options="iconCls:'icon-ok'" style="padding:5px 0px;width:300px;" id="gobtn">
					<span style="font-size:14px;">进入系统</span>
				</a>
			</div>
		</div>
	</div>
	<script>
		function login() {
			if($('#loginname').textbox('getValue') == '') {
				$("#msg").html("请输入用户名");
			} else if($('#password').textbox('getValue') == '') {
				$("#msg").html("请输入密码");
			} else {
				$("#gobtn").linkbutton("disable");
				eui.ajax({
					url:'${path}/login!user.action',
					data: {loginname: $('#loginname').textbox('getValue'), password: $('#password').textbox('getValue')},
					success:function(result){
						if(result == 0) {
							if(window.location.href.indexOf('login.jsp') != -1) {
								window.location.href = "${path}/eframe/auth/index.jsp";
							} else {
								window.location.href = window.location.href;
							}
						} else {
							if(result == 1) {
								$("#msg").html("登录名不存在");
							} else if(result == 2) {
								$("#msg").html("密码不正确");
							} else {
								$("#msg").html("服务器错误");
							}
							$("#gobtn").linkbutton("enable");
						}
					}
				});
			}
		}
		
		function clearMsg(valid) {
			$("#msg").html("&nbsp;");
		}
		
		$(function(){
			$('#loginname').textbox('focus')
			document.onkeydown = function(e){ 
				var ev = document.all ? window.event : e;
			    if(ev.keyCode==13) {
			    	login();
			    }
			}
		});
	</script>
</body>
</html>